package com.nulldev.util.image2;

import java.awt.Color;
import java.awt.image.BufferedImage;
import java.util.Random;

import com.nulldev.util.math.MathUtil;

@Deprecated
public abstract class ImageFilter {
	public abstract BufferedImage process(final String command, final BufferedImage input);
	
	public void onProgress(final int currentPosX, final int currentPosY, final int currentPixel) {}
	
	public BufferedImage cloneCoreImage(final BufferedImage input) {
		return new BufferedImage(input.getWidth(), input.getHeight(), input.getType());
	}
	
	private final Random rand = new Random();
	public Color randomColor() {
		final float r = rand.nextFloat();
		final float g = rand.nextFloat();
		final float b = rand.nextFloat();
		return new Color(r, g, b);
	}
	
	protected int invert(int color) {
		  return color ^ 0x00ffffff;
	}
	
	protected int getRandomNumberFrom(final int min, final int max) {
		return MathUtil.randInt(min, max);
	}
}
